clear all
load ParEst_eh0_time0_Mex_guys ParEst_eh0_time0_Mex_guys
load trans_time1_eh0_comp1.out
Chute =ParEst_eh0_time0_Mex_guys;
HandleLo = @Principal_A2_n_1;

Dij=trans_time1_eh0_comp1(1,:)'; % Read transition moments

Dnf_1	 =	Dij(1);
Dni_1	 =	Dij(2);
Dfn_1	 =	Dij(3);
Dff_1	 =	0;
Dfi_1	 =	Dij(4);
Din_1	 =	Dij(5);
Dii_1	 =	0;
Dif_1  =	Dij(6);

Lower =[Dfn_1,Din_1,Dnf_1,Dni_1,Dfi_1,Dif_1];
LoBo =zeros(1,13);
LoBo = [Lower, 0.1, 0.1, 0.1, 0.1, -10, -10, -10];
HiBo = [.81 .81 .81 .81 .81 .81 10 10 10 10 -4 5 0];
%options = optimoptions(@simulannealbnd, ...
 %                    'PlotFcn',{@saplotbestf,@saplottemperature,@saplotf,@saplotbestx,@saplotx},...
  %                    'FunctionTolerance',800,'ReannealInterval',2, ...
   %                  'InitialTemperature', 2*10^4*[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10 10 10 10 10 60], ...
    %                 'TemperatureFcn', @temperaturefast, 'MaxStallIterations', 4000);
                 options = saoptimset( ...
                     'TolFun',5000,'ReannealInterval',6, ...
                     'InitialTemperature', 10^2*[1 1 1 1 1 1 10 10 10 10 6 15 10], ...
                     'TemperatureFcn', @temperaturefast, 'TimeLimit', 1.5*86400); % default 14*
[x,fval,exitflag,output]  = simulannealbnd(HandleLo, Chute, LoBo, HiBo, options)
ParEst_eh0_time0_Mex_guys = x;
save ParEst_eh0_time0_Mex_guys ParEst_eh0_time0_Mex_guys
